package Thread;

public class MyThread2 extends Thread {
    private String name;

    public MyThread2(String name) {
        this.name = name;
    }

    @Override
    public void run() {
        for (int i = 0; i < 5; i++) {
            System.out.println(name + "运行" + i);
        }
        try {
            sleep((int) Math.random() * 10);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
    }
}
